<extend name="Public/header" />
<block name="main">
<div class="panel panel-default">
    <div class="panel-heading">
        DataTables Advanced Tables                 
    </div>
    <!-- /.panel-heading -->
    <div class="panel-body">
        <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
        <div class="row">
            <form role="form" action="{:U('selindex')}" method="get" enctype="multipart/form-data">
                <div class="col-sm-6">
                </div>
                <div class="form-group input-group">
                    <input type="text" class="form-control" name="selname" value="关键字">
                    <span class="input-group-btn">
                        <button type="submit" class="btn btn-default" ><i class="fa fa-search"></i>
                        </button>
                    </span>
                </div>
            </form>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <table width="100%" class="table table-striped table-bordered table-hover dataTable no-footer dtr-inline" id="" role="grid" aria-describedby="dataTables-example_info" style="width: 100%;">
                    <thead>
                        <tr >
                            <th>No.</th>
                            <th>分类名称</th>
                            <th>图片</th>
                            <th>状态</th>
                            <th>添加时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody> 
                        <foreach name="list" item="val">
                            <tr class="odd gradeX" align="center">
                                <td>{++$i}</td>
                                <td>{$val.name}</td>
                                <td>
                                    <if condition="$val['img'] EQ '' ">
                                         没有图片
                                        <else />
                                        <img width="100" src="__ROOT__{$val['img']}" alt="">
                                    </if>
                                </td>
                                <td class="center qj">{$val['state'] == 1 ? '启用' : '隐藏'}</td>
                                <td class="center">{:date('Y-m-d H:i:s',$val['time'])}</td>
                                    <td class="center">
                                    <a href="{:U('sel',['id'=>$val['id']])}" class="btn btn-outline btn-primary">查看子类</a>
                                     <a href="javascript:void (0)" class="btn btn-outline btn-success" onclick="qj(this,{$val['id']})">{$val['state'] == 1 ? '隐藏' : '启用'}</a>
                                    <a href="{:U('edit',['id'=>$val['id']])}" class="btn btn-outline btn-primary">编辑</a>
                                    <a href="{:U('del',['id'=>$val['id']])}" class="btn btn-outline btn-danger" onclick="del(this,{$val['id']})"class="del">删除</a>
                                </td>
                               
                            </tr>
                        </foreach>
                    </tbody> 
                </div>
            </div>
        </table>
                       
                    
                        <div class="row">
                            <div class="col-sm-6">
                            <div class="dataTables_info" id="dataTables-example_info" role="status" aria-live="polite">Showing 1 to 10 of 57 entries
                            </div>
                       </div>
                       <div class="col-sm-6">
                           <div class="dataTables_paginate paging_simple_numbers" id="dataTables-example_paginate">
                               <ul class="pagination">
                                   <li class="paginate_button previous " aria-controls="dataTables-example" tabindex="0" id="dataTables-example_previous"><a href="#">Previous</a>
                                   </li>
                                   <li class="paginate_button active" aria-controls="dataTables-example" tabindex="0">
                                    <a href="#">1</a>
                                   </li>
                                
                                   <li class="paginate_button next" aria-controls="dataTables-example" tabindex="0" id="dataTables-example_next"><a href="#">Next</a>
                                   </li>
                                 </ul>
                             </div>
                         </div>

                            <!-- /.table-responsive -->
                        
                        </div>
                        <!-- /.panel-body -->
                    </div>
</block>